package com.ly.mp.dal.comm.config.condition;

import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class TransactionPolicyNone extends TransactionPolicy {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        String transactionPolicy = this.getTransactionPolicy(context);
        return StringUtils.isNotBlank(transactionPolicy) && !this.getTransactionPolicy().equals(transactionPolicy);
    }

    protected String getTransactionPolicy() {
        return "none";
    }
}